package calculate;

public class Calculate {
	public int sumNumMath(int n) {
		return n * (n + 1) / 2;
	}
	
	public int sumNumCircular(int n) {
		int res = 0;
		for(int i = 1;i <= n;i++) {
			res += i;
		}
		return res;
	}
	
	public int sumNumRecursion(int n) {
		if(n == 1) return 1;
		n += sumNumRecursion(n - 1);
		return n;
	}
	
	public int sumNum(int n) {
		boolean x = n > 1 && (n += sumNum(n - 1)) > 0;
		return n;
	}
}
